package com.andnnl;

import com.andnnl.api.demo.DemoService;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * Created by chenss on 2019/8/16.
 */
@SpringBootApplication
public class DubboConsumerDemo {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Reference(version = "1.0.0")
    private DemoService demoService;

    public static void main(String[] args) {
        SpringApplication.run(DubboConsumerDemo.class,args);
    }
    @Bean
    public ApplicationRunner runner() {
        return args -> {
            System.out.println("ssssssssssssssss");
            logger.info(demoService.sayHello("asdfasdfasdf"));
        };
    }
}